#include "pch.h"
#include "MainWindow.h"

struct ComInitializer
{
	ComInitializer()
	{
		HR(CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED));
	}

	~ComInitializer()
	{
		CoUninitialize();
	}
};

int __stdcall wWinMain(HINSTANCE, HINSTANCE, PWSTR, int)
{
	ComInitializer com;

	MainWindow window;

	MSG msg = {};
	while (msg.message != WM_QUIT)
	{
		if (PeekMessage(&msg, nullptr, 0, 0, PM_REMOVE))
		{
			DispatchMessage(&msg);
		}
		else
		{
			window.Render();
		}
	}
}